#define _CRT_SECURE_NO_WARNINGS  1
#pragma warning(disable:6031)

#include <stdio.h>

int main()
{
    char string[101] = { '\0' };
    char* p[100];
    int i = 0;
    int j = 0;

    for (i = 0; i < 100; i++)
    {
        p[i] = NULL;
    }

    i = 0;
    while ((string[i] = getchar()) != '\n')
    {
        i++;
    }
    string[i] = '\0';
    int x = i;

    for (i = 0, j = 0; i < x; i++)
    {
        if (string[i] >= 'a' && string[i] <= 'z' || string[i] >= 'A' && string[i] <= 'Z')
        {
            p[j] = &string[i];
            j++;
            i++;
            while (string[i] != ' ' && string[i] != '\0')
            {
                i++;
            }
            string[i] = '\0';
        }
    }

    for (j = j - 1; j >= 0; j--)
    {
        printf("%s ", p[j]);
    }
    return 0;
}